<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio1" ng-model="data" value="1">小区用户
</label>
<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio2" ng-model="data" value="2">导入用户
</label>
<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio3" ng-model="data" value="3">3天不活跃用户
</label>
<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio4" ng-model="data" value="4">达人用户
</label>
<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio5" ng-model="data" value="5">v认证用户
</label>
<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio6" ng-model="data" value="6">未认证用户
</label>
<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio7" ng-model="data" value="7">单个用户
</label>

<label class="radio-inline">
    <input type="radio" name="inlineRadioOptions" id="inlineRadio8" ng-model="data" value="8">兴趣爱好
</label>

<div class="form-group" style="margin-top: 30px">
    <div class="form-group">
        <label class="control-label" for="textinput">小区:</label>
        <select ng-model="communityId" ng-options="m.objId as m.communityName for m in communityLabelList.data"
                ng-change="getAllList(communityId)">
            <option value="">-- 请选择 --</option>
        </select>
    </div>

    <input type="file" ng-show="data == 2" onchange="angular.element(this).scope().handleFiles(this.files)">
    <input type="text" class="form-control" placeholder="用户id" style="margin-left: 20px;width: 200px" required
           ng-model="userId" ng-show="data==7">

    <div ng-show="data==8">
        <label class="radio-inline" ng-repeat="hobby in hobbies.data">
            <input type="radio" name="hobbyRadio" id="hobby{{$index}}" ng-model="$parent.hobbyName"
                   value="{{hobby.value}}">{{hobby.value}}
        </label>
    </div>
</div>
<input class="form-control input-lg" type="text" placeholder="通知内容" ng-model="title">
<div class="tabbable" id="tabs-932122" style="margin-top: 40px" ng-show="data !=null&&communityId!=null">
    <!-- Only required for left/right tabs -->
    <ul class="nav nav-tabs">
        <li class="active"><a data-toggle="tab" href="#tab_question" ng-click="initCurrentPage(1)">话题</a></li>
        <li><a data-toggle="tab" href="#tab_neighbour" ng-click="initCurrentPage(2)">邻里活动</a></li>
        <li><a data-toggle="tab" href="#tab_notice" ng-click="initCurrentPage(3)">公告</a></li>
        <li><a data-toggle="tab" href="#tab_topic" ng-click="initCurrentPage(4)">专题</a></li>
        <li><a data-toggle="tab" href="#tab_activity" ng-click="initCurrentPage(5)">抽奖活动</a></li>
    </ul>
    <paging ng-show="table==1||table==2">
        <ul class="pagination" num-pages="tasks.pageCount" current-page="tasks.currentPage"
            on-select-page="selectPage(page)">
            <li ng-class="{disabled: noPrevious()}"><a ng-click="selectPrevious()">&laquo;</a>

            </li>
            <li ng-repeat="page in pages" ng-class="{active: isActive(page)}"><a
                    ng-click="selectPage(page)">{{page}}</a>

            </li>
            <li ng-class="{disabled: noNext()}"><a ng-click="selectNext()">&raquo;</a>

            </li>
        </ul>
    </paging>
    <div class="tab-content">
        <div class="tab-pane active" id="tab_question">

            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>标签</th>
                    <th>问题描述</th>
                    <th>创建者</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="question in questionList">
                    <td width="100">{{question.community.communityName}}</td>
                    <td width="200"><span ng-repeat="t in question.tag">{{t}} </span>
                    </td>
                    <td width="400">{{question.desc}}</td>
                    <td width="200">{{question.createdBy.nickName}}</td>
                    <td width="200">{{question.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="showPushMessage(title,question,1)">
                            推送
                        </button>
                    </td>
                </tr>

                </tbody>
            </table>

        </div>
        <div class="tab-pane" id="tab_neighbour">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>描述</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="activity in neighbourActivityList">

                    <td width="200">{{activity.community.communityName}}</td>
                    <td width="400">【{{activity.title}}】{{activity.desc}}</td>
                    <td width="200">{{activity.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="showPushMessage(title,activity,6)">
                            推送
                        </button>
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane" id="tab_notice">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>标题</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="notice in noticeList">

                    <td width="200">
                        <div ng-repeat="c in notice.community">
                            {{c.communityName}}
                        </div>
                    </td>
                    <td width="400">{{notice.title}}</td>
                    <td width="200">{{notice.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="showPushMessage(title,notice,2)">
                            推送
                        </button>
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane" id="tab_topic">
            <table class="table">
                <thead>
                <tr>
                    <th>小区</th>
                    <th>标题</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="topic in topicList">

                    <td width="200">
                        <div ng-repeat="c in topic.community">
                            {{c.communityName}}
                        </div>
                    </td>
                    <td width="400">{{topic.title}}</td>
                    <td width="200">{{topic.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="showPushMessage(title,topic,3)">
                            推送
                        </button>
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane" id="tab_activity">
            <table class="table">
                <thead>
                <tr>
                    <th>标题</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="activity in activityList">

                    <td width="400">{{activity.title}}</td>
                    <td width="100">
                        <button type="button" class="btn btn-default btn-xs"
                                ng-click="showPushMessage(title,activity,4)">
                            推送
                        </button>
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<div class="modal fade" id="showPushMessage">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">推送内容：</h4>
            </div>
            <div class="modal-body">
                <p>
                <ul>
                    <li>推送内容：{{message.desc}}</li>
                    <li>类型：{{message.tag}}</li>
                    <li>描述：{{message.content}}</li>
                    <li>预计发送人数：{{message.uList.length}}</li>
                </ul>

                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="confirmPush()">发送</button>

            </div>
        </div>
    </div>
</div>


<script>
    $(function () {
        $('#tabs-932122 a').click(function (e) {
            e.preventDefault();//阻止a链接的跳转行为
            $(this).tab('show');//显示当前选中的链接及关联的content
        })
    })
</script>
